<?php
/*
 * This page is to show profile page for user.
 */
$tu = true;
include '../../include/config.php';
$profile_photo_path = 'http://' . $_SERVER['HTTP_HOST'] . '/salusme/storage/profile_photo/';
include 'all.php';
?>

<?php include '../head.php'; ?>
<title>My Account</title>

<body>
    <div id="wrapper">

        <?php include '../header_profile.php'; ?>
        <?php include '../menu_left.php'; ?>
        <div class="salus_bank_reg float_left">


    <a class="float_left" href="http://<?= $_SERVER['HTTP_HOST'] ?>/salusme/user">
        <!--                    <div class="salus_bank_logo logo"></div>-->
        <img src="../../include/images/logo_sakusbank.png" width="104px;" height="60px;" />                
        <div class="down_arrow"></div>
    </a>

    <?php
    $getbaby = mysql_query("select * from salus_buy_product where FK_fa_user_id='" . $_COOKIE['gid'] . "' and product_id ='2'  ") or die(mysql_error());
    if (mysql_num_rows($getbaby) != 0) {
        ?>
        <a class="float_left" href="http://<?= $_SERVER['HTTP_HOST'] ?>/salusbaby" >
            <img src="../../include/images/baby.png" width="104px;" height="50px;" />
        </a>
    <?php }
    ?>


    <div class="clear"></div>

        

        <div class="clear"></div>
        <script>
            function valid(){
                var p1 = document.forms['psw']['pass1'].value;
                var p2 = document.forms['psw']['pass2'].value;
                if(p1=='' || p2==''){
                    alert("Fill Fields");
                    return false;
                }
            }
        </script>



        <div id="mainContent">                                       
            <hr>
            <fieldset>
                <?php if ($_GET['e'] != '') { ?>    <font color="red">Error : <b><?= $_GET['e'] ?></b></font> <?php } ?>
                <?php if ($_GET['s'] != '') { ?>    <font color="Green">Success : <b><?= $_GET['s'] ?></b></font> <?php } ?>
                <legend>Change Password</legend>
                <br>
                <form action="../acc/cng_pass.php" method="post" name="psw" onsubmit=" return valid()" >
                    <table>
                        <tr>
                            <td>Current Password :</td>
                            <td><input type="password" id="pass1" name="password1" style="height: 30px;" placeholder="Current Password" required /> </td>
                        </tr>
                        <tr>
                            <td>New Password :</td>
                            <td><input type="password" id="pass2" name="password2" style="height: 30px;" placeholder="New Password" required  /> </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><input type="submit" value="Change Password" style="width: 175px; height: 35px;" /> </td>
                        </tr>
                    </table>
                </form>
            </fieldset>




            <fieldset  >
                <legend>Profile Photo</legend>
                <?php
                $p0 = mysql_query("select photo from salus_user_profile_detail where FK_fa_user_id='" . $_COOKIE['gid'] . "'") or die(mysql_error());
                while ($p1 = mysql_fetch_array($p0)) {
                    $photo = $p1['photo'];
                }
                ?>
                <center><img src="<?= $profile_photo_path . $photo ?>" alt="profile_photo" height="100px" width="100px" />
                    <form method="post" action="../acc/pro_photo.php" enctype="multipart/form-data" >
                        <input type="file" name="uploadedfile" required />
                        <input type="hidden" name="MAX_FILE_SIZE" value="100000000000" />
                        <input type="submit" value="Change" style="width: 100px; height: 35px; " />                    
                    </form>
                </center>
            </fieldset>

            <?php
            /*
             * Showing List of accounts
             */
            ?>


           
        </div>

    </div><!-- wrapper over    -->
    <?php
    include '../../include/config.php';
    include '../menu_right.php';
    ?>
</body>
</html>